package Router

import (
	"api/Collert"
	"github.com/gin-gonic/gin"
)

func Router(r *gin.Engine) {
	// 1.创建路由
	// 默认使用了2个中间件Logger(), Recovery()
	// 路由组1 ，处理GET请求
	shop := r.Group("/shop")
	// {} 是书写规范
	{
		shop.POST("/add", Collert.ShopAdd)
		//秒杀商品列表
		shop.GET("/list", Collert.ShopList)
	}
	shopTiem := r.Group("/shoptime")
	{
		shopTiem.POST("/add", Collert.ShopTimeAdd)
		//时间
		shopTiem.GET("/info", Collert.ShopTimeInfo)
	}
	Order := r.Group("/order")
	{
		Order.POST("/add", Collert.Order)
		//删除
		Order.GET("/delete", Collert.OrderDelete)
	}
	r.Run(":8000")
}
